import get_local from '@dfeidao/atom-wxapp//local/get';
import { IFeidaoAiWeappPage } from '@dfeidao/atom-wxapp/interfaces';
import set_local from '@dfeidao/atom-wxapp/local/set';
import render from '@dfeidao/atom-wxapp/render/render';
export default async function a004(fd: IFeidaoAiWeappPage, e: {
	currentTarget: {
		dataset: {
			num: number;
			index: string;
		}
	}
}) {
	const num = e.currentTarget.dataset.num;
	const key = 'dataArray[' + e.currentTarget.dataset.index + '].number_storage';
	const param = {};
	param[key] = num;
	const select_index = e.currentTarget.dataset.index;

	const data = get_local(fd, 'data') as Array<{ number_storage: number }>;
	// console.log(key, 'a004');
	// console.log(param, 'a004');
	// console.log(select_index, typeof (select_index));
	data[select_index].number_storage = num;
	set_local(fd, 'data', data);
	render(fd, {
		dataArray: data
	});

}
